package com.lucun.insurance.controller;

import com.lucun.insurance.db.entity.InsureEntryStaff;
import com.lucun.insurance.service.InsureEntryStaffService;
import com.lucun.insurance.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: 郭鑫
 * @catalogue: com.lucun.insurance.controller
 * @Date: 2021/9/9 17:16
 * @Version: 1.0
 */
@RestController
@RequestMapping("/insureEntrStaff")
public class InsureEntryStaffController {
    @Autowired
    InsureEntryStaffService insureEntryStaffService;

    //    查询所有
    @RequestMapping("/findAll")
    public List<InsureEntryStaff> findAll() {
        return insureEntryStaffService.findAll();
    }

    //    添加
    @RequestMapping("/insert")
    public JsonResult<?> insert(@RequestBody InsureEntryStaff insureEntryStaff) {
        return insureEntryStaffService.insert(insureEntryStaff);
    }
//    修改
    @RequestMapping("/update")
    public JsonResult<?> update(@RequestBody InsureEntryStaff insureEntryStaff){
        return insureEntryStaffService.update(insureEntryStaff);
    }
//    删除
    @RequestMapping("/delete")
    public JsonResult<?> delete(@RequestBody InsureEntryStaff insureEntryStaff){
        return insureEntryStaffService.delete(insureEntryStaff);
    }
}